package com.reny.ll.git.base_logic.app_task

import com.orhanobut.logger.AndroidLogAdapter
import com.orhanobut.logger.Logger
import com.reny.ll.git.core.App
import com.reny.ll.git.core.taskdispatch.task.Task


class InitLogger : Task() {

    override fun needWait(): Boolean = true

    override fun run() {
        /*if (App.isDebug) {
            Timber.plant(Timber.DebugTree())
        } else {
            Timber.plant(object : Timber.Tree() {
                override fun log(
                    priority: Int,
                    tag: String?,
                    message: String,
                    t: Throwable?
                ) {
                    Timber.d(tag, message)
                }
            })
        }*/

        Logger.addLogAdapter(object : AndroidLogAdapter() {
            override fun isLoggable(priority: Int, tag: String?): Boolean {
                return App.isDebug
            }
        })

        /*if(App.isDebug) {
            *//*Timber.plant(Timber.DebugTree())

            Timber.tag("Timber")*//*
        }*/
    }

}